<template>
  <div class="tree">
    <el-tree
      ref="tree"
      :data="UserGroupData"
      default-expand-all
      highlight-current
      :show-checkbox="true"
      :check-strictly="true"
      node-key="id"
      @check-change="selectChange"
    />
  </div>
</template>

<script>
import { getBranchList } from '@/api/uc/search'

export default {
  name: 'SelectPersonnelTree',
  props: ['review', 'UserGroupData'],
  data() {
    return {
      reviewData: []
    }
  },
  mounted() {
    console.log(this.UserGroupData, 'UserGroupData')
    // this.getSearch()
  },
  methods: {
    // // 获取数据
    // async getSearch() {
    //   let data = await getBranchList()
    //   console.log(data, 'data')
    //   let reviewData = data.data.groupUserTree
    //   this.reviewData = reviewData
    // },
    selectChange() {
      // 关键
      const reviews = this.$refs.tree.getCheckedNodes()
      this.$emit('update:review', reviews)
    }
  }
}
</script>

<style scoped>

</style>
